package com.lingx.web.api.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.lingx.service.ProcessEngineService;
import com.lingx.web.api.IApi;

@Component
public class Api8002 extends AbstractAuthApi implements IApi {
	@Resource
	private JdbcTemplate jdbcTemplate;
	@Resource
	private ProcessEngineService processEngineService;

	@Override
	public int getApiCode() {
		return 8002;
	}

	@Override
	public String getApiName() {
		return "执行操作";
	}

	@Override
	public Map<String, Object> api(Map<String, Object> params) {
		Map<String, Object> ret = null;
		if (params.get("e") == null&&params.get("ecode") == null) {
			return IApi.getRetMap(-1, "参数e不可为空");
		}
		try {
			ret = processEngineService.process(params);
		} catch (Exception e) {
			e.printStackTrace();
			ret = IApi.getRetMap(-1, e.getLocalizedMessage());
		}
		return ret;
	}

}
